package com.qire.manhua.model.enumeration;

/**
 * 漫画书状态：下架、未上架、上架、已过期
 */
public enum BookStatus {
    DownShelves(-1),        //-1 下架
    NONE(0),                //0  未上架，
    UpShelves(1),           //1  上架
    Expired(2);             //2  为已过期,版权过期无效

    public final int statusValue;

    BookStatus(int statusValue){
        this.statusValue = statusValue;
    }

    public static BookStatus build(int statusValue){
        BookStatus status;
        switch (statusValue){
            case -1:
                status = DownShelves;
                break;
            case 0:
                status = NONE;
                break;
            case 1:
                status = UpShelves;
                break;
            case 2:
                status = Expired;
                break;
            default:
                status = NONE;
        }
        return status;
    }
}
